package com.classroommanagesystem.security;

/**
 * @author victory
 * @date 2025/10/26 12:36
 */

import com.classroommanagesystem.exception.BusinessException;

public class RoleConvertUtil {
    public static String convertRole(Integer roleId) {
        return switch (roleId) {
            case 1 -> RoleConstant.ROLE_SUPERADMIN;
            case 2 -> RoleConstant.ROLE_ADMIN;
            case 3 -> RoleConstant.ROLE_USER;
            default -> throw new BusinessException("未知角色");
        };
    }
}
